package com.alan.weather.utils;

import com.alan.weather.entity.weather.*;
import com.alan.weather.service.weather.*;


import java.util.HashMap;
import java.util.Map;


public class SystemUtils {
    private static Map<String, String> ALL_PATHS = new HashMap<String, String>();
    static {
        ALL_PATHS.put("step1_input", "/brazil_weather");
        ALL_PATHS.put("step1_output", "/step1_output");

        ALL_PATHS.put("step2_input", "/step1_output");
        ALL_PATHS.put("step2_output", "/step2_output");

        ALL_PATHS.put("step3_1_input", "/step1_output");
        ALL_PATHS.put("step3_1_output", "/step3_1_output");

        ALL_PATHS.put("step3_2_input", "/step1_output");
        ALL_PATHS.put("step3_2_output", "/step3_2_output");

        ALL_PATHS.put("step3_3_input", "/step1_output");
        ALL_PATHS.put("step3_3_output", "/step3_3_output");

        ALL_PATHS.put("step3_4_input", "/step1_output");
        ALL_PATHS.put("step3_4_output", "/step3_4_output");

        ALL_PATHS.put("step3_5_input", "/step1_output");
        ALL_PATHS.put("step3_5_output", "/step3_5_output");

        ALL_PATHS.put("step3_6_input", "/step1_output");
        ALL_PATHS.put("step3_6_output", "/step3_6_output");

        ALL_PATHS.put("step3_7_input", "/step1_output");
        ALL_PATHS.put("step3_7_output", "/step3_7_output");

        ALL_PATHS.put("step3_8_input", "/step1_output");
        ALL_PATHS.put("step3_8_output", "/step3_8_output");
    }

    public static WeatherData_OneDay query_one_day(String date) {
        // 成功执行返回类，不正确执行，则返回null
        return Step2.run(ALL_PATHS.get("step2_input"), ALL_PATHS.get("step2_output"), date);
    }

    public static WeatherData_HighestEveryYear query_highest() {
        // 成功执行返回类，不正确执行，则返回null
        return Step3_1.run(ALL_PATHS.get("step3_1_input"), ALL_PATHS.get("step3_1_output"));
    }

    public static WeatherData_LowestEveryYear query_lowest() {
        // 成功执行返回类，不正确执行，则返回null
        return Step3_2.run(ALL_PATHS.get("step3_2_input"), ALL_PATHS.get("step3_2_output"));
    }

    public static WeatherData_AverageEveryYear query_average() {
        return Step3_3.run(ALL_PATHS.get("step3_3_input"), ALL_PATHS.get("step3_3_output"));
    }


    public static WeatherData_RainyEveryYear query_rainy() {
        return Step3_4.run(ALL_PATHS.get("step3_4_input"), ALL_PATHS.get("step3_4_output"));
    }

    public static WeatherData_PredictOneDay predictOneDay(String date) {
        return Step3_5.run(ALL_PATHS.get("step3_5_input"), ALL_PATHS.get("step3_5_output"), date);
    }

    public static WeatherData_PredictOneWeek predictOneWeek(String date) {
        return Step3_6.run(ALL_PATHS.get("step3_6_input"), ALL_PATHS.get("step3_6_output"), date);
    }

    public static WeatherData_MouthOfYearHighest mouthOfYearHighest(String year) {
        return  Step3_7.run(ALL_PATHS.get("step3_7_input"), ALL_PATHS.get("step3_7_output"), year);
    }

    public static WeatherData_MouthOfYear mouthOfYear(String year) {
        return Step3_8.run(ALL_PATHS.get("step3_8_input"), ALL_PATHS.get("step3_8_output"), year);
    }

}
